<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Construct Web | Category Form</title>
</head>
<body>
	<center>
		<div style="color: teal; font-size: 30px">Construct Web |
			Category Form</div>
			
		<c:if test="${!empty categoryList}">
			<table border="1" bgcolor="black" width="600px">
				<tr style="background-color: teal; color: white; text-align: center;"
					height="40px">
					<td>Id</td>
					<td>Name</td>
					<td>Edit</td>
					<td>Delete</td>
				</tr>
				
				<c:forEach items="${categoryList}" var="category">
					<tr style="background-color: teal; color: white; text-align: center;"
						height="40px">
						<td>${category.id}</td>
						<td>${category.name}</td>
						<td><a href="edit-category-form?id=${category.id}">Edit</a></td>
						<td><a href="deleteCategory?id=${category.id}">Delete</a></td>
					</tr>
				</c:forEach>
				
			</table>
		</c:if>
		
		<a href="insert-category-form">Click here to add new Category</a>
	</center>
</body>
</html>